package com.xmotor.testjavaxvalidation.controller;

import com.xmotor.testjavaxvalidation.vo.R;
import com.xmotor.testjavaxvalidation.vo.TestVO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@Validated //从注解在没有接收单个参数（即都是VO对象接收时）可以不加
@RestController
@RequestMapping("/test")
public class TestController extends BaseController {



    @RequestMapping(value = "/{tag}/test1",method = RequestMethod.POST)
    public R test1(@PathVariable(value = "tag") String tag, @RequestBody @Valid TestVO testVO){
        System.out.println(tag);
        System.out.println(testVO);
        return ok();
    }


}
